package org.tc.client.alipay.config;

import java.io.FileWriter;
import java.io.IOException;


/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */


public class AlipayConfig {

    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2016091700535230";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCfPKqEjiJM3Rg7w7eHloD4mkZtKQ0mnNWb5tylKyNGtKYpS+68tcFL0DPCvTSYw1F4H9WJaRYAR9oQlRR68UhQi8yQWCgj36mHFQsrdFfhprTTlJ3qdvymn3m61mblComlD2QX507RA+t40RA94POhTd66g29kY87emuyTx3taKlUw6fyiQxzgOUl5i9wjrNyZoUn79nfPoTzsqguXorpht7wgCfPAZ+seW1WOreoxlR30dkwroWPxwXEfbjNYfPTgzQFQ0Njip/KxGlkoljRh1jzqlXAXG3sMHawKTYxMSR0mXzKCcLpRF1Iz2Z1ZfSKOlb9nbE9AtgbV+P0890hzAgMBAAECggEBAJ0vsI9bEubXFVXhlCim27cL61tUO6QTCxVzZfkxRQhFyQRY7Vig/idNZdrlFKd7ns86dXrIHiy2wL6/utDFnwHLjmoqa61F2r36euUxWpLoEfYN7XiGbk44fFx/ymBr74XdVIv4DChteyLvFN5QUY64JJXuqqXplErPmZsjPlO4hMCbxy4iNCKKhg/+v0MjMxAmKGI0CQhimNr2f6NItr17JrNrYgtqR6aFo4UfaliPKqMRehLYqj62S9mO9PJeuTdpIgFeEKLCNTtdWm5xQ/bbu2lOAIsAc0D3bVegp9PMvYZs0nw+oTybax4BjkyVv64HvcB+d+jfZaVHnddeFzkCgYEA62doBqkzrS/vd/J9pwJnWRHYfl02N7jAWPqoKyJLyVWZkvdqOirHZ2ZcqeXjrbUD8Agd41CDu0q3nKCmgyJXMXBQ4RuzBnp1eQjrmAZnyCv4IeGYYEPGWN/sCHa5P44q5yhUg8aB/kyk26nLGXWzblgOgGpvto9ZIIz2sYzxMIUCgYEArStEWUw45vdSERXUjQLGoYInB2U6aR+U64lyNMEkM/E0pgc+ubQ48JWvZpWQ/4jhNkWaN2n7X6lNv5YSlVVPtv9hU4qob9vbf0AHMQ7zZnHBnvdluJ4oCGbqU2+f54BHAP9dsi86SFAzQrDlvlMSG15wP3lZ54yx2H3pPQ3aIpcCgYAhXYnAD/F0JawyextWNaACXuYpmvqZUUVqFzUI0Baf1dMroofa8L9Mp5SQvDXWJCcHuY7K7lmNjVyTBa40PgTPzBSao3tveqH14s7JwHarR5gm7TvUwSZ26F4jIPjGylbIZs3704IPUju3qsxPsoAZLr/3cZ6d6JmAZJp+tfRlpQKBgQCBV03HvOzLZnL/m+SUJjyiKYppNay5FAOxIYoR6SjXOxPt5n9tSTU2TTcjUhdpJZ3BYZ9cQGam/te5f6gFriDKOFlDgs9oLTj3BKXaeKZIIDNUPsjVahvQmr3u7/LpgKCIGDStgCTyGiUPbP1MeNOPaaxBXKxQDIBRiUoKdiw1pQKBgQCd9gvrg+LfavXMnR8H/mKmfMHz6jbSIQA+M0FqgcE7aEdrt63r9haFnqwQiYj/v8Ls59XUc+9eZWd5PwfCLg0+uyGy1GRDaZJqDA9DX+gviwNWvb5lUgQnvNBYi5DR8Gb6bNssMHmAgyxs8ieMGVh23SHa5TF7sV41k4auYjrvWQ==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnzyqhI4iTN0YO8O3h5aA+JpGbSkNJpzVm+bcpSsjRrSmKUvuvLXBS9Azwr00mMNReB/ViWkWAEfaEJUUevFIUIvMkFgoI9+phxULK3RX4aa005Sd6nb8pp95utZm5QqJpQ9kF+dO0QPreNEQPeDzoU3euoNvZGPO3prsk8d7WipVMOn8okMc4DlJeYvcI6zcmaFJ+/Z3z6E87KoLl6K6Ybe8IAnzwGfrHltVjq3qMZUd9HZMK6Fj8cFxH24zWHz04M0BUNDY4qfysRpZKJY0YdY86pVwFxt7DB2sCk2MTEkdJl8ygnC6URdSM9mdWX0ijpW/Z2xPQLYG1fj9PPdIcwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://ivr3ur.natappfree.cc/payafter.html";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://ivr3ur.natappfree.cc/payafter.html";

    // 签名方式 ``````````````````````````````````````````````
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do\n";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     *
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis() + ".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }

}
